import Vue from "vue";
import App from "./App";
import store from "./store";
import widget from "./service/api/widget";
import uView from "uview-ui";
import yqdCom from "@/components/materals/index";
import theme from "@/const/theme";
import { router, RouterMount } from "./router";
import { showMessage } from "@/utils/asyncMessage";
import { getUserLocation } from "@/utils/location";
import CusCell from "@/components/cusCell";
import draggable from "@/utils/vuedraggable.umd.min.js";
import navigateModal from "@/components/navigateModal";
import navigateBaseConfig from "@/components/navigateConfig/base";
import navigateItemConfig from "@/components/navigateConfig/item";
Vue.config.productionTip = false;
Vue.prototype.$store = store;
Vue.prototype.$widget = widget;
Vue.prototype.$theme = theme;
Vue.prototype.$showMessage = showMessage;

App.mpType = "app";
Vue.prototype.$getUserLocation = getUserLocation; //定位信息
Vue.use(uView);
Vue.use(yqdCom);
Vue.use(router);
Vue.component("CusCell", CusCell);
Vue.component("draggable", draggable);
Vue.component("navigateModal", navigateModal);
Vue.component("navigateBaseConfig", navigateBaseConfig);
Vue.component("navigateItemConfig", navigateItemConfig);
uni.$u.setConfig({
  // 修改$u.config对象的属性
  config: {
    unit: "px",
  },
});

const app = new Vue({
  store,
  ...App,
});
//v1.3.5起 H5端 你应该去除原有的app.$mount();使用路由自带的渲染方式
// #ifdef H5
RouterMount(app, router, "#app");
// #endif

// #ifndef H5
app.$mount(); //为了兼容小程序及app端必须这样写才有效果
// #endif
